<template>
  <el-dropdown
    v-bind="$attrs"
    trigger="click"
    class="theme"
    @command="handleSetTheme"
  >
    <!-- 图标 -->
    <div>
      <el-tooltip>
        <template #content>{{$t('msg.navBar.themeChange')}}</template>
        <svg-icon :icon="`change-theme`"></svg-icon>
      </el-tooltip>
    </div>
    <!-- menu -->
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item command="color">
          {{ $t('msg.theme.themeColorChange') }}
        </el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>

  <!-- 弹出层 -->
  <div>
    <select-color v-model="selectColorVisible"></select-color>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import SelectColor from './SelectColor/index.vue'

const handleSetTheme = (command) => {
  selectColorVisible.value = true
}
// dialog
const selectColorVisible = ref(false)
</script>

<style lang="scss" scoped></style>
